home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 3565-4.665 / dmg-3609 / news.txt / stos5.asc < prev    next >
Text File  |  1989-04-05  |  7KB  |  126 lines

  1.                     STOS BASIC TUTORIAL - PART FIVE
  2.                     -------------------------------
  3.  
  4.                        Written by Lozian for STEN
  5.  
  6.  
  7.  
  8.  This time we are going to concentrate on designing your own drop down or
  9.  be pulled down Menu's. For a start, boot up your Copy of STOS and type
  10.  in the following lines ...
  11.  
  12.  10 MODE 0:FLASH OFF:KEY OFF 
  13.  20 MENU$(1) = "Menu No. 1":Rem Any text of your choice between quotes.
  14.  30 MENU$(2) = "   Menu No. 2":Rem 2nd Menu entry.Spaces to make neat.       
  15.  
  16.  Menu$(1) and Menu$(2) sets up the 1st and 2nd Menu on the Menu Bar,but
  17.  will do nothing until you give the command in line 59 of MENU ON.
  18.  
  19.  To continue ...
  20.  
  21.  40 MENU$(1,1) = "This is Entry No.1"
  22.  50 MENU$(1,2) = "This is Entry No.2"
  23.  51 MENU$(2,1) = "This is Entry No.1"
  24.  52 MENU$(2,2) = "This is Entry No.2"
  25.  
  26.  We have now set up what is to drop down from the Menu Bar and we can
  27.  call it with ...
  28.  
  29.  59 MENU ON 5,1:Rem 1st parameter denotes Border type.(Range 1 to 16.)
  30.                      2nd parameter denotes 1=drop down or 2=pull down.
  31.  Nothing will actually happen here yet that you are aware of,except that
  32.  the menu bar will appear on screen but you cannot select from it until
  33.  you insert, in your listing, a selection routine as follows .....
  34.  
  35.  60 OPTION = mnbar : CHOICE = mnselect:curs off:Rem 2 variables to take
  36.  control of the Menu selection.Curs off MUST be placed here.
  37.  70 if OPTION = 1 and CHOICE = 1 then cls:locate 1,10:print "You have
  38.  selected Menu No.1,Entry No.1"
  39.  80 if OPTION = 1 and CHOICE = 2 then cls:locate 1,11:print "You have
  40.  selected Menu No.1,Entry No.2"
  41.  90 if OPTION = 2 and CHOICE = 1 then cls:locate 1,10:print "You have
  42.  selected Menu No.2,Entry No.1"
  43.  95 if OPTION = 2 and CHOICE=2 then cls:locate 1,11:print "You have
  44.  selected Menu No.2,Entry No.2"
  45.  98 goto 60:Rem Loop to allow you to select.
  46.  
  47.  Run this program and observe what happens ....
  48.  
  49.  You can if you wish use Mode 1 which gives you a wider screen and hence
  50.  scope for more Menu's. Once the Menu is set up,Bank 15 is used and so
  51.  cannot be used for anything else, unless the Menu's are not required.
  52.  Spaces are used in the listings at the equals sign for clarification
  53.  and should be left out. If you decide to use Mode 1,remember that you
  54.  are restricted with colours. 
  55.  
  56.  Quite simple,once you know how,and remember that once the MENU ON 
  57.  command is called,the Menu will run under interrupt and continue to do
  58.  so unless you give the command MENU OFF in a later program line.
  59.  
  60.  The selection process can be cut down by using variables,but in this
  61.  tutorial context it makes it easier to follow.
  62.  
  63.  So now that you can set up a Menu Bar try experimenting with all the
  64.  various options and see how you get on. Insert colour to brighten it
  65.  up and with the experience you gain on the SPRITE editor you can create
  66.  some attractive Menu's. You can also use ICON$ in the Menu's.
  67.  
  68.  Now we will move on to say a little about SPRITES which incidentally
  69.  also run under interrupt. Obviously I cannot show you how to design a
  70.  good Sprite but there are some good examples on the discs supplied.
  71.  With a 520 not expanded,memory limitations exist. I found a handy tip
  72.  in a magazine to conserve some memory and I suggest you apply it to your
  73.  COPY of STOS. VERY IMPORTANT - Load "SPRITE.ACB". Do not load as an
  74.  accessory or you will not be able to list it.
  75.  With the SPRITE.ACB in memory do a list of line 7015. It should
  76.  read 7015 Reserve as work 8,max(16384,min(free,32768)). Change the
  77.  32768 to 10000 and save your SPRITE.ACB back to disc. You will now
  78.  have more scope for animation etc. within the SPRITE editor. Please
  79.  note when you save it back to disk use the name SPRITE.ACB. Then you
  80.  can reload it as an accessory. If you are not sure what you are doing,
  81.  use a BACKUP of your COPY to experiment with. There is NO substitute
  82.  to making BACKUP'S. YOU HAVE BEEN WARNED !!!
  83.  
  84.  Designing a good Sprite relies on your own imagination. So be bold and
  85.  experiment,especially with the colours in your design,and you will
  86.  discover that the simplest of designs look good. Try out your Sprite
  87.  in a short program to get the effect of it.
  88.  
  89.  After your Sprite or Sprites are to your liking,save them to disc with
  90.  a name you can identify them with e.g. ROCKETS.MBK and use a .MBK as
  91.  a extender. If at a later stage you incorporate these Sprites within
  92.  a program and save the program with a .BAS extender,on subsequent re-
  93.  loading the Sprites will be available from within STOS and will not
  94.  require to be re-loaded from disc. They will occupy BANK 15.          
  95.  
  96.  Designing a mouse pointer is relatively easy once you can weave your
  97.  way round the Sprite editor. Design a Sprite as normal remembering it
  98.  is going to be the mouse pointer. Within STOS there are three different
  99.  mouse pointers. Normal is the arrow No.1,next is the hand No.2 and No.
  100.  3 is a clockface. These are always available. Try CHANGE MOUSE 2 and 
  101.  the pointer should change to a hand. So remember if you design your own
  102.  mouse pointer, it will become No.4,and any further designs will become
  103.  5 or 6 etc. So to change to your own design use CHANGE MOUSE 5 or your
  104.  choice. To expand a bit more on this theme, BANK 15 holds the Sprites
  105.  and when you use the command to change the mouse pointer, say CHANGE
  106.  MOUSE 4, you are actually calling on the first Sprite design in BANK 15.
  107.  Therefore CHANGE MOUSE 6 would request Sprite No.3 in the BANK. So in
  108.  effect the mouse pointer can be considered as a Sprite.
  109.  
  110.  The importance of using effective names for your .MBK files cannot be
  111.  stressed enough. As you may now understand ROCKETS.MBK is obviously
  112.  Sprite's while the pointers could be named MOUSES.MBK. You may remember
  113.  the files when you are working on them but I can assure you that unless
  114.  you have a very good memory, in a few days time you will find it very
  115.  difficult to differentiate between the different files, unless a little
  116.  thought is applied to their names. Alternatively you could jot down the
  117.  names on paper,with notes relavent to what they are.
  118.  
  119.  Next time we will look at the commands to get your Sprites up on the
  120.  screen and moving. So get designing and all will become clear. The
  121.  STOS manual would be handy if you have got one to refer to. Have fun.
  122.  
  123.  
  124.                                                     (c) Lozian MCMXC11
  125.                                                          Banffshire.
  126.